package top.revery.admin.controller_common;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.revery.api.config.HttpResponResult;
import top.revery.api.config.ResultType;

/**
 * <h1> ---  --- </h1>
 * Created by  revery.top jun
 * Date  2019-12-18 16:44
 */
@RestController
@RequestMapping("/common/miniApi/")
public class Common {

    /*
     * 发送短信
     * */
    @PostMapping("/sendSMS")
    HttpResponResult sendSMS(String tel){
        HttpResponResult httpResponResult = null;

        try{
//            String code = FeignServiceMapping.userServiceDataSource.sendsms(tel);
//
//            if(!code.equals("0")){
//                throw new Exception(code);
//            }

            httpResponResult = new HttpResponResult(ResultType.SUCCESS);

        }catch (Exception e){
            e.printStackTrace();
            httpResponResult = new HttpResponResult(ResultType.ERROR_SERVICE,e.getMessage());
            httpResponResult.exception = e;
        }

        return httpResponResult;
    }

}
